$(function(){
 var pjId = $("#pjdh_mx_id").val();
$('#pjdh_mx_grid').datagrid({
    url:$.webPath() + "/zjgl/pjgl/find_pjdhList?pjId="+pjId,
    fitColumns:true,
    singleSelect:true,
    pagination:true,
    fit:true,
    rownumbers:true,
    striped:true,
    columns:[[
        {field:'nbgs_jc', title:'公司名称', width:25,align: 'center'},
        {field:'pjlx', title:'票据类型', width:15,align: 'center',
            formatter:function (value) {
                if (value == '0')
                    return '银票';
                else
                    return '商票';
            }},
        {field:'pjhm', title:'票据号码', width:15,align: 'center'},
        {field:'yfcpyh_qc', title:'出票行', width:15,align: 'center'},
        {field:'dqje', title:'金额', width:30,align: 'right',
            formatter:function(value){
                var sl = formatJe(value,",");
                return sl;
            }
        },
        {field:'bzj', title:'保证金', width:30,align: 'right'},
        {field:'dqr', title:'到期日', width:30,align: 'center'},
        {field:'spr_jc', title:'收票人', width:12,align: 'center'},
        {field:'yflx', title:'应付利息', width:30, align: 'right',
            formatter:function(value){
                var sl = formatJe(value,",");
                return sl;
            }
        },
        {field:"syrq" ,title:"使用日期",width:40,align: 'center'},
        {field:"bz" ,title:"备注",width:40,align: 'center'},
        {field:"status" ,title:"状态",width:15,align: 'center',
            formatter:function (value) {
                if (value == 1)
                    return '可操作';
                if (value == 2)
                    return '已贴现';
                if(value== 3)
                    return '已托收';
                if(value== 4)
                    return '已承兑';
                if(value== 5 )
                    return '已使用';
                if(value== 6 )
                    return '已兑换';
            }}]]
});
});

